feat: Add Flex Query support with automatic query memory#16
Merged
Conversation
Add comprehensive Flex Query Web Service integration to enable retrieval of account statements, trade confirmations, and historical data from Interactive Brokers. Flex Queries are automatically saved for easy reuse. Features: - Execute Flex Queries with automatic retry and polling for results - Auto-save executed queries with friendly names from API responses - List all previously used Flex Queries - Forget/delete saved queries by ID or name - Optional XML parsing to JSON for easier data consumption - Persistent storage of query metadata in user's home directory New Components: - FlexQueryClient: HTTP client for IB Flex Web Service API v3 * sendRequest: Initiate query execution * getStatement: Retrieve query results with polling * executeQuery: High-level method combining both steps * parseStatement: Convert XML responses to JSON - FlexQueryStorage: Persistent storage manager for query metadata * JSON-based storage in ~/.interactive-brokers-mcp/flex-queries.json * CRUD operations for saved queries * Query lookup by ID, IB query ID, or friendly name * Automatic timestamp tracking (created, last used) Configuration: - IB_FLEX_TOKEN: Environment variable for Flex Web Service token - Queries auto-saved on first execution with name from API - Optional friendly name override during execution Testing: - 17 tests for FlexQueryClient covering all API interactions - 24 tests for FlexQueryStorage covering all storage operations - 10 additional tests for tool handlers covering Flex Query tools - All tests passing (120 passed, 1 skipped) Documentation: - Updated README with Flex Query configuration instructions - Added links to IB documentation for setup - Documented all three new MCP tools Breaking Changes: None - purely additive feature
|
🎉 This PR is included in version 1.19.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add comprehensive Flex Query Web Service integration to enable retrieval of account statements, trade confirmations, and historical data from Interactive Brokers. Flex Queries are automatically saved for easy reuse.
Features:
New Components:
FlexQueryClient: HTTP client for IB Flex Web Service API v3
FlexQueryStorage: Persistent storage manager for query metadata
Configuration:
Testing:
Documentation:
Breaking Changes: None - purely additive feature